//
//  Utils.h
//  AppFinance
//
//  Created by wei on 12-4-11.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

#define K_UTILS_UIColorFromRGB(rgbValue, alphaValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:alphaValue]

#define K_UTILS_UIColorWithRGB(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]


// 2015-01-19 18:01:02  YYYY-MM-dd HH:mm:ss
// 2015/1/19 18:01:02  YYYY/MM/dd HH:mm:ss
#define AF_UTILS_DATA_FORMAT_1 @"YYYY-MM-dd HH:mm:ss"


enum {
    UIDevice_iPhone3                = 1,    // iPhone 1,3,3GS Standard Resolution   (320x480px)
    UIDevice_iPhone4                = 2,    // iPhone 4,4S High Resolution          (640x960px)
    UIDevice_iPhone5                = 3,    // iPhone 5 High Resolution             (640x1136px)
    UIDevice_iPad2                  = 4,    // iPad 1,2 Standard Resolution         (1024x768px)
    UIDevice_iPad3                  = 5     // iPad 3,4 High Resolution             (2048x1536px)
}; typedef NSUInteger UIDeviceResolution;


@interface AFUtils : NSObject
{
    
}

////////////////////////////////////////////////////////////////////////////////
//****************************************************************************//
////////////////////////////////////////////////////////////////////////////////
#pragma mark - 时间
+ (NSString *) unixTime:(NSString*) unixTime format:(NSString*) format;
+ (NSString *) unixTime:(NSString*) unixTime;
+ (NSString *) unixTimeHand:(NSString*) unixTime;
+ (NSString *) unixTimePoint:(NSString*) unixTime;
+ (NSString *) unixTimePointMin:(NSString*) unixTime;
+ (NSString *) unixTimePointYYYYMMDDHHMM:(NSString*) unixTime;
+(NSString*) GetWeekForDate:(NSString *) strDate;

+ (int) unixTimeMinute:(NSString*) unixTime;

+ (NSString*) stringToDate:(NSString *)_time;

+ (NSString*) stringToDate:(NSString *)_time withFormat:(NSString *)format;

+ (int)nowMinute;

+ (NSString *)nowDataChangeMinToUnixTime:(int)_min;

+ (NSString *) dateStringAForNow;
+ (long long int)localUnixTime;
+ (NSString *) dateStringNowForFormat:(NSString*)_format;

#pragma mark - UIDevice
+ (UIDeviceResolution) currentResolution;
#pragma mark - MD5
+(NSString *)md5:(NSString *)str;

    
////////////////////////////////////////////////////////////////////////////////
//****************************************************************************//
////////////////////////////////////////////////////////////////////////////////
#pragma mark - 颜色
+ (UIColor *) UIColorFromRed:(float) red green:(float) green blue:(float) blue;
+ (UIColor *) UIColorFromRGB:(int) rgbValue alpha:(float) alphaValue;

+ (void) alertMessage:(NSString *) inmsg;
+(void)alertMessageNoButton:(NSString *) inmsg;
@end
